package com.acceptable.qucun.generic.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Component
@ConfigurationProperties(value = "qucun.file")
public class FileItem {
    @Value("root-dict-prefix")
    private String rootDictPrefix;

    // 当使用前缀方式进行配置时 变量名必须为与注解值的只含字母的形式一致
    @Value("default-head-img-path")
    private String defaultHeadImgPath;

    @Value("undeleted-file-dict-id")
    private String undeletedFileDictId;

    @Value("undeleted-file-dict-name")
    private String undeletedFileDictName;

    @Value("chunk-temp-dict-id")
    private String chunkTempDictId;

    @Value("chunk-temp-dict-name")
    private String chunkTempDictName;

    @Value("dustbin-dict-id")
    private String dustbinDictId;

    @Value("dustbin-dict-name")
    private String dustbinDictName;

    @Value("chunk-size")
    private String chunkSize;

    // 从删除时间算起到真正物理删除的天数
    @Value("max-rest-day")
    private String maxRestDay;

    @Value("zip-default-mime")
    private String zipDefaultMime;

    @Value("buffer-array-size")
    private String bufferArraySize;

    public Long getUndeletedFileDictId() {
        return Long.parseLong(undeletedFileDictId);
    }

    public Long getChunkTempDictId(){return Long.parseLong(chunkTempDictId);}

    public Long getDustbinDictId(){return Long.parseLong(dustbinDictId);}

    public Long getMaxRestDay(){return Long.parseLong(maxRestDay);}

    public int getBufferArraySize(){return Integer.parseInt(bufferArraySize);}


}
